#pragma once

#include <iostream>
#include "cocos2d.h"

using namespace std;
using namespace cocos2d;

#define USER_DEFAULT_CURRENT_ICON "user_default_current_icon"

#define USER_DEFAULT_WIN_COUNT "user_default_win_count"
#define USER_DEFAULT_HOURSE_CARD_FORMAT "user_default_get_hourse_card_%d"
#define USER_DEFAULT_MONEY_CARD_FORMAT "user_default_get_money_card_%d"
#define USER_DEFAULT_30_CARD_COUNT "user_default_get_30_hourse_card_count"
#define USER_DEFAULT_1_CARD_COUNT "user_default_get_1_hourse_card_count"
#define USER_DEFAULT_MAX_MONEY_IN_ONE_GAME "user_default_max_money_in_on_game"
#define USER_DEFAULT_SUM_MONEY "user_default_sum_money"

#define USER_DEFAULT_RESULT_COUNT "user_default_result_count"
#define USER_DEFAULT_RESULT_ICON "user_default_result_icon_%d"
#define USER_DEFAULT_RESULT_DATA "user_default_result_data_%d"
#define USER_DEFAULT_RESULT_MONEY "user_default_result_money_%d"
#define USER_DEFAULT_RESULT_RANK "user_default_result_rank_%d"
#define USER_DEFAULT_RESULT_PLAYER_COUNT "user_default_result_player_count_%d"

class AchievementManage
{
	AchievementManage();
	~AchievementManage();

	static AchievementManage* s_pAchievementManage;
	vector<int> m_rgIconValues;

public:
	static AchievementManage* getInstance();

	bool checkIconCanUse(int nIconIndex);
	int getCurrentIconIndex();
	int getCurrentValue(int nIconIndex);

	void setCurrentIconIndex(int nIconIndex);
	void getAHouseCard(int nHourseIndex);
	void getAMoneyCard(int nMoneyIndex);
	void getMoneyAfterGame(int nMoney);
	void recordResult(int nMoney);
	bool checkHourseCardHasGot(int nHourseIndex);
	bool checkMoneyCardHasGot(int nMoneyIndex);
};